package com.hulizuofang.wol.chat.client.data;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class ChatUserIndex {
	private Map<String, ChatUser> mapLogin = new HashMap<String, ChatUser>();
	private Map<String, ChatUser> mapId = new HashMap<String, ChatUser>();
	
	public ChatUserIndex() {
	}
	
	public void update(Set<ChatUser> set) {
		for (ChatUser c : set) {
			mapLogin.put(c.getLogin(), c);
			mapId.put(c.getId(), c);
		}
	}
	
	public ChatUser getByLogin(String login) {
		return mapLogin.get(login);
	}

	public ChatUser getById(String id) {
		return mapId.get(id);
	}
}
